package com.czxy.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Id;
import javax.persistence.Table;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;


/**
 *   `uid` int(11) NOT NULL AUTO_INCREMENT,
 *   `login_name` varchar(50) DEFAULT NULL,
 *   `login_pwd` varchar(32) DEFAULT NULL,
 *   `age` int(11) DEFAULT NULL,
 *   `birthday` date DEFAULT NULL,
 *   `sex` varchar(1) DEFAULT NULL,
 *   `education` varchar(50) DEFAULT NULL,
 *   `telephone` varchar(11) DEFAULT NULL,
 *   `interest` varchar(100) DEFAULT NULL,
 *   `remark` varchar(200) DEFAULT NULL,
 *   PRIMARY KEY (`uid`)
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@Table(name = "t_user")
public class User {
    @Id
    private Integer uid;
    private String loginName;
    private String loginPwd;
    private Integer age;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;
    private String sex;
    private String education;
    private String telephone;
    private String interest;
//    private String[] interestArr;
    private String remark;

    public  String getDateStr() {

       DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
       String s = df.format(birthday);
       return s;

    }





//    public  String  getInterest(){
//        if (interestArr != null){
//            interest = Arrays.toString(interestArr).replace("[","").replace("]","");
//        }
//        return interest;
//    }























}
